package com.job.DQH.dqh718.homework;

import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str;
        int[] winNums;
        int[] buyerNums;
        int level;

        System.out.print("本期奖池已开奖！");
        winNums = LotteryNum.createNum();
        System.out.println("这次的中奖号码是："+ Arrays.toString(winNums));

        while(true){
            System.out.println("输入你的幸运数字购买彩票，或者输入exit退出！");
            str = sc.next();
            if(str.equals("exit"))
                break;
            buyerNums = LotteryNum.createNum();
            level = LotteryNum.prizeLevel(winNums,buyerNums);
            System.out.println("你的号码是："+Arrays.toString(buyerNums));
            if(level == 0){
                System.out.println("很遗憾你没有中奖。好运一定会到来的，也许就是下次！");
                continue;
            }
            if(level == 7){
                System.out.println("WOW!!!你中了特等奖!!!");
            }
            System.out.println("恭喜！你中了"+(7-level)+"等奖！这不再接再厉，再来一发？");
        }

        System.out.println("欢迎下次再来！");

    }



}
